package com.feather.common.converter.simple.fieldassignment;

import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.Field;

import org.apache.commons.fileupload.FileItem;

import com.feather.common.converter.FieldAssignment;

/**
 * @author flogyin
 */
public class FileItem_OutputStream implements FieldAssignment {
	@Override
	public Object assign(Object value, Object obj, Field field) {
		OutputStream os = null;
		FileItem fileItem = (FileItem) value;
		if (fileItem != null) {
			try {
				os = fileItem.getOutputStream();
			} catch (IOException ex) {

			}
		}
		return os;
	}
}
